<template>
  <section class="comp-top-panel">
    <div class="box-hp">
      <div class="label text-center">生命</div>
      <div class="text text-center style-font">{{ player.hp }}</div>
    </div>
    <div class="box-time">
      <div class="label text-center">时间</div>
      <div class="text text-center style-font">{{ nowClock }}（{{ system.events.length }}）</div>
    </div>
    <div class="box-totem-status">
      <div class="label text-center">邪恶图腾</div>
      <div class="text text-center style-font">{{ player.gotTotem ? '已找到' : '未找到' }}</div>
    </div>
  </section>
</template>

<script>
import player from '@/models/Player'
import system from '@/models/system'

const clockMap = [
  '9:00 PM',
  '10:00 PM',
  '11:00 PM',
  '12:00 PM'
]

export default {
  data () {
    return {
      player,
      system
    }
  },

  computed: {
    nowClock () {
      return clockMap[this.system.time]
    }
  }
}
</script>

<style scoped lang="less">
.comp-top-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  z-index: 20;
  left: 24px;
  top: 24px;
  right: 24px;
  padding: 24px;
  border: 4px solid red;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.9);
  .label {
    margin-bottom: 6px;
    color: #fff;
  }
  .text {
    color: red;
    font-size: 34px;
    font-weight: bold;
  }
}
</style>
